package serializer

import (
	"fmt"
	"go-mall/model"
	"go-mall/pkg/util"
)

type Money struct {
	UserId    uint   `json:"user_id" form:"user_id"`
	UserName  string `json:"user_name" form:"user_name"`
	UserMoney string `json:"user_money" form:"user_money"`
}

func BuildMoney(item *model.User) Money {
	money, _ := util.DecryptMoney(item.Money)
	fmt.Println("item.Money", item.Money)
	return Money{
		UserId:    item.ID,
		UserName:  item.UserName,
		UserMoney: money,
	}
}
